[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
procedure                Declares a Procedure

 procedure  <pname>(<parameters>);

   <declarations>

 begin
   <statements>
 end;

    A procedure is a subprogram: a set of declarations and statements that
    are executed by issuing the statement:

         <pname>;

    in any following subprogram or in the main program itself. A procedure
    may be recursive, that is, the statement above can appear in the
    <statements> of the procedure <pname>.

         <pname>    The procedure's name.

    <parameters>    An optional list of parameters. If no parameters are
                    declared, then the parentheses are dropped.

  <declarations>    Local LABEL, CONST, TYPE, VAR, PROCEDURE, and FUNCTION
                    declarations.

    <statements>    Zero or more legal statements.

  -------------------------------- Example ---------------------------------

    The following procedure swaps two integer values:

           procedure Swap(var A,B : Integer);

           var
             T : Integer;

           begin
             T := A;
             A := B;
             B := T
           end;

See Also: function program begin end
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson